package org.jeecg.modules.business.takestockplan.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.basic.warehouse.entity.WmsBasicWarehouse;
import org.jeecg.modules.business.takestockplan.entity.TakeStockPlan;
import org.jeecg.modules.business.takestockplan.mapper.TakeStockPlanMapper;
import org.jeecg.modules.business.takestockplan.service.ITakeStockPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 盘点计划
 * @Author: jeecg-boot
 * @Date:   2023-08-02
 * @Version: V1.0
 */
@Service
public class TakeStockPlanServiceImpl extends ServiceImpl<TakeStockPlanMapper, TakeStockPlan> implements ITakeStockPlanService {

    @Autowired
    private TakeStockPlanMapper takeStockPlanMapper;

    @Override
    public Page<TakeStockPlan> listByPage(Page<TakeStockPlan> page, TakeStockPlan takeStockPlan) {
        return page.setRecords(takeStockPlanMapper.listByPage(page, takeStockPlan));
    }

    /**
     * 根据仓库组查询仓库
     * @param warehouseGroupId
     * @return
     */
    @Override
    public List<WmsBasicWarehouse> getWarehouseByGroup(String warehouseGroupId) {
        return takeStockPlanMapper.listWarehouseByGroup(warehouseGroupId);
    }
}
